package com.frame.database.operate;

import java.io.Serializable;
import java.util.List;
import java.util.Map;

import org.hibernate.HibernateException;

import com.frame.database.TableBean;

/**
 * @Title: 系统
 * @Description:
 * @Copyright: Copyright (c) 2012
 * @Company:
 * @author 王海锋
 * @CreatedTime:2012-6-10 上午11:32:17
 * @version 1.0
 */

abstract public class JBaseOperate implements JdbcOperate{

    abstract public Jsession getSession();

    public TableBean getBean(Class classes,Serializable key) throws Exception{
        return getSession().getBean(classes, key);
    }
    public void saveBean(TableBean... beans) throws Exception{
        Jsession session=getSession();
        for(TableBean bean:beans)
            session.save(bean);
    }
    public void saveBean(String tableName,Map dataMap) throws Exception{
        getSession().save(tableName,dataMap);
    }
    public void delete(TableBean bean) throws HibernateException, Exception{
        getSession().delete(bean);
    }
}
